home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / public / rayshade / Reconfigure < prev   
Text File  |  1994-08-01  |  1KB  |  66 lines

  1. #!/bin/sh
  2. #
  3. # Reconfigure
  4. # Extract .SH files using values in config.sh
  5. #
  6. # Useful in environments in which the source tree
  7. # is used to build executables for more than one kind of machine.
  8. # After running Configure on a particular machine, copy the
  9. # resulting config.sh to, for example, config.sh.SPARC.
  10. # When you have to recompile for some reason, running
  11. # "Reconfigure config.sh.SPARC" should produce the correct Makefiles
  12. # and the like.
  13. #
  14. # If you need to run "make depend" for a machine other than the one
  15. # that the Configure script was last run for, you will need to remake
  16. # the "mkdep" script by removing it, copying the appropriate
  17. # config.sh.MACHINE file to config.sh, and running "Configure -d".
  18. #
  19.  
  20. case "$1" in
  21. '')
  22.     configfile="./config.sh"
  23.     ;;
  24. *)
  25.     if test -f "$1" ; then
  26.         configfile="$1"
  27.     else
  28.         echo "$1 does not exist."
  29.         exit
  30.     fi
  31. esac
  32.  
  33. echo "Reconfiguring using $configfile."
  34. . $configfile
  35.  
  36. echo " "
  37. echo "Doing variable substitutions on .SH files..."
  38. set x `awk '{print $1}' <MANIFEST | $grep '\.SH'`
  39. shift
  40. case $# in
  41. 0) set x *.SH; shift;;
  42. esac
  43. if test ! -f $1; then
  44.     shift
  45. fi
  46. for file in $*; do
  47.     case "$file" in
  48.     */*)
  49.     dir=`$expr X$file : 'X\(.*\)/'`
  50.     file=`$expr X$file : 'X.*/\(.*\)'`
  51.     (cd $dir && . $file)
  52.     ;;
  53.     *)
  54.     . $file
  55.     ;;
  56.     esac
  57. done
  58. if test -f config.h.SH; then
  59.     if test ! -f config.h; then
  60.     : oops, they left it out of MANIFEST, probably, so do it anyway.
  61.     . config.h.SH
  62.     fi
  63. fi
  64.  
  65. echo "You must run 'make depend' then 'make'."
  66.